Skip to content

ci: add MIT license, CI, and tag-driven release workflow - #2

Merged
SafeEval merged 3 commits into
mainfrom
agent/ci-and-license
Jul 30, 2026
Merged

ci: add MIT license, CI, and tag-driven release workflow#2
SafeEval merged 3 commits into
mainfrom
agent/ci-and-license

Conversation

@SafeEval

Copy link
Copy Markdown
Member

Closes the two gaps before going public: no license, and a README that documented a release process the repo didn't actually have.

Context

A v1.0.0 tag was pushed at 7c41ab2, but no release was ever cut — the Releases page is empty. So go install ...@v1.0.0 was the only way to get the tool, and there was nothing for users without a Go toolchain. There was also no CI of any kind.

LICENSE

MIT, Copyright (c) 2026 DivergentCodes. Linked from a new README section.

ci.yml — push to main, and PRs

  • gofmt (checked via -l, since gofmt exits 0 even when it reformats)
  • go vet
  • go test -race ./...
  • Zero-dependency guard — fails if a require block ever appears. This repo's central claim is "zero third-party dependencies"; without a check, that silently rots the first time someone adds one. I negative-tested this against a throwaway module with a real dependency to confirm it actually fires rather than passing vacuously.
  • Dogfooding — builds the linter and lints the commits being built, --range on PRs and the tip commit on push.

release.yml — on v* tags

Cutting a release becomes git tag v1.0.1 && git push origin v1.0.1:

  • Runs tests first — a tag that fails its own tests shouldn't publish
  • Cross-compiles linux/darwin (amd64 + arm64) and windows/amd64, CGO_ENABLED=0 -trimpath
  • Stamps the tag into the existing main.version var via ldflags, so commitlint version stops reporting 0.0.0-dev
  • Verifies the built binary reports the tagged version before publishing — a binary that disagrees with its tag is worse than no release
  • Uploads .tar.gz/.zip archives (each with LICENSE + README) plus checksums.txt, with --generate-notes

permissions: is scoped per workflow — contents: read for CI, contents: write only for release.

Verification

  • Ran the full cross-compile + packaging locally: archives and checksums produced correctly
  • Confirmed the version stamp works (v1.0.1 stamped, 0.0.0-dev unstamped)
  • Negative-tested the dependency guard against a module with a real dep
  • Validated both workflows parse as YAML and every run block passes bash -n
  • Confirmed the dogfooding step passes on this branch's own commit, with both the current and post-fix linter

Note on ordering

Per our discussion, this leaves the existing v1.0.0 tag alone — it predates the comment-stripping fix in #1, so it marks a build where the documented git hook rejects valid commits. Nothing was ever published under it, so no one can be broken. Suggested order: merge #1, merge this, then tag v1.0.1 as the first real release. The README already points at v1.0.1.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VSrrciEDBTuFNMtKocScML

The repo had no CI and no license, and the README described a release
process that did not exist: a v1.0.0 tag was pushed but no release was
ever cut, so `go install ...@v1.0.0` was the only way to get the tool and
nothing was published for users without a Go toolchain.

Add MIT LICENSE (copyright DivergentCodes) and two workflows:

ci.yml runs on push to main and on PRs: gofmt, vet, `go test -race`, a
guard that fails if a third-party dependency ever appears (the project's
central claim), and a dogfooding step that lints the commits being built.

release.yml triggers on `v*` tags: tests, cross-compiles for linux,
darwin, and windows, stamps the tag into main.version via ldflags,
verifies the built binary reports the tagged version before publishing,
and uploads archives with a checksums.txt alongside autogenerated notes.

Update the README's Releases section to describe the actual process and
document the prebuilt-binary install path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSrrciEDBTuFNMtKocScML
@SafeEval
SafeEval marked this pull request as ready for review July 30, 2026 16:29
SafeEval and others added 2 commits July 30, 2026 09:31
The dogfooding step linted `origin/<base>..HEAD`, but actions/checkout
fetches a single shallow branch, so `origin/main` does not exist in the CI
clone and git exited 128. It passed locally only because a normal
worktree has the full history.

Fetch the PR base commit explicitly and lint against that sha instead.
Verified against a real `--depth 1` clone, which reproduces the failure
before the fetch and resolves the range after it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSrrciEDBTuFNMtKocScML
On pull_request events actions/checkout checks out the merge commit
GitHub builds for the PR, whose subject is `Merge <sha> into <sha>`. That
is not a conventional subject, so the dogfooding step failed on a branch
whose own commits are all fine.

`--no-merges` does not help here: a range endpoint is always included, and
HEAD *was* the merge commit. Lint up to the PR's real branch tip instead,
fetching both endpoints so the range resolves in the shallow checkout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSrrciEDBTuFNMtKocScML
@SafeEval
SafeEval merged commit 9f950ca into main Jul 30, 2026
1 check passed
@SafeEval
SafeEval deleted the agent/ci-and-license branch July 30, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant